package com.atguigu.spzx.user.controller;

import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.atguigu.spzx.user.service.UserBrowseHistoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: UserBrowseHistoryConteoller
 * @Package: com.atguigu.spzx.user.controller
 * @Description 浏览历史
 * @Author 孤妤
 * @Date: 2023/12/22 19:32
 */
@Tag(name = "浏览历史")
@RestController
@RequestMapping("/api/user/userBrowseHistory/")
public class UserBrowseHistoryController {
    @Autowired
    private UserBrowseHistoryService userBrowseHistoryService;
    @Operation(summary = "保存浏览历史")
    @GetMapping("/save/{userId}/{skuId}")
    public Result addUserBrowseHistoryPage(@PathVariable Integer userId,
                                           @PathVariable Integer skuId){
        userBrowseHistoryService.addUserBrowseHistoryPage(userId,skuId);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
